package com.abl.lib.excel;

import com.abl.lib.excel.simple.Sheet0;
import com.abl.lib.excel.simple.Sheet0Listener;
import com.abl.lib.excel.simple.Sheet1;
import com.abl.lib.excel.simple.Sheet1Listener;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class _Test {
    public static void main(String[] args) {
        String path = "C:\\Users\\Administrator\\Desktop\\EasyExcelDemo.xlsx";

        ExcelReader excelReader = EasyExcel.read(path).build();

        try (excelReader) {
            ReadSheet readSheet1 =
                    EasyExcel.readSheet(0).headRowNumber(1).head(Sheet0.class).registerReadListener(new Sheet0Listener()).build();

            ReadSheet readSheet2 =
                    EasyExcel.readSheet(1).headRowNumber(3).head(Sheet1.class).registerReadListener(new Sheet1Listener()).build();

            excelReader.read(readSheet1, readSheet2);

        }


    }
}